package dailyTopic;

/**
 * @author zhangmin
 * @create 2021-07-30 14:56
 */
public class titleToNumber171 {
    public int titleToNumber(String columnTitle) {
        char[] c=columnTitle.toCharArray();
        int n=c.length;
        int num=0;
        for (int i=0;i<n;i++){
            num=num*26+(c[i]-'A'+1);
        }
        return num;
    }
   /* public static void main(String[] args) {
        //int[] nums1=new int[]{3,5,4,2,4,6};
        //int[] nums2=new int[]{2,3,5};
        String columnTitle = "AB";
        dailyTopic.titleToNumber171 object=new dailyTopic.titleToNumber171();
        System.out.println(object.titleToNumber(columnTitle));
    }*/
}
